package com.leonzhangxf.vdt.validation;

import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * A demo domain object for demonstrate the field validation.
 *
 * @author leonzhangxf
 * @date 20190423
 */
@Builder
@Data
public class Student {

    @NotBlank(message = "学员姓名不能为空！")
    private String name;

    @Min(value = 0, message = "学员年龄不在正常范围内！")
    @Max(value = 150, message = "学员年龄不在正常范围内！")
    private Integer age;

    @Email(message = "邮箱格式不正确！")
    private String email;
}
